package cn.wolfcode.domain;

import cn.wolfcode.enums.AnnouncementEnum;
import cn.wolfcode.enums.AppointmentEnum;
import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
@Getter
@Setter
public class Announcement {
    /** */
    private Long id;
    /** */
    private String title;
    /** */
    private Employee createPerson;
    /** */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date createTime;
    /** */
    private Integer level;
    /** */
    private Boolean ifread;
    /** */
    private Boolean status;

    private String content;

    public String getLevelName(){
        return AnnouncementEnum.findStatusName(this.level);
    }

    public String toJson() {
        return JSON.toJSONString(this);
    }


}